package com.tedu.springdemo.day01;

import java.io.Serializable;

/**
 *
 * @author 佳琪
 *
 * 创建Person对象       实体类JavaBean定义【具体的类】规则
 * 属性
 * 方法
 * 构造器
 */
public class Person implements Serializable {//实现序列化接口,数据传输二进制
    private String name;
    private int age;

    //方法
    public void say(){
        System.out.println("说~");
    }
    public void eat(){
        System.out.println("吃~");
    }

    //构造器默认空参
    public Person() {
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
